{include file="header.tpl"}
{if isset($info)}
	<div class="info i_red">
		{$info}
	</div>
{/if}			
{if isset($smarty.session.user_id)}
<h3>Nowa oferta praktyki</h3>
<form action="new_practice.php" method="post">
	<div class="table_div">
		<table>
			{if $smarty.session.user_type == 'user_company'}
				{foreach item=company from=$smarty.session.company_info}
				{/foreach}
				<input type="hidden" name="company_id" id="company_id" value="{$company.id}"/>
				<tr>
					<td><label for="company_name" class= "label">Nazwa firmy</label></td>
					<td><p>{$company.name}</p></td>
					<td></td>
				</tr>
				<tr>
					<td><label for="company_address" class= "label">Adres</label></td>
					<td><p>{$company.address}</p></td>
					<td></td>
				</tr>
				<tr>
					<td><label for="company_phone" class= "label">Telefon</label></td>
					<td><p>{$company.phone}</p></td>
					<td></td>
				</tr>
				<tr>
					<td><label for="company_site" class= "label">Strona www</label></td>
					<td><p><a href="http:\\{$company.site}" target=_blank>{$company.site}</p></a></td>
					<td></td>
				</tr>
				<tr>
					<td><label for="company_person" class="label">Osoba reprezentująca</label></td>
					<td>
						<select id="company_person" name="company_person" class="input">
							{foreach item=person from=$company_persons} 
								<option value="{$person.id}">{$person.name} {$person.surname}</option>
							{/foreach}
						</select>
					</td>
					<td></td>
				</tr>
				
			{/if}
			<tr>
				<td><label for="date_start" class="label">Od dnia (RRRR-MM-DD)</label></td>
				<td><input type="text" id="date_start" name="date_start" class="input"/></td>
				<td></td>
			</tr>
			<tr>
				<td><label for="date_end" class="label">Do dnia (RRRR-MM-DD)</label></td>
				<td><input type="text" id="date_end" name="date_end" class="input"/></td>
				<td></td>
			</tr>
			<tr>
				<td><label for="amount" class="label">Ilość miejsc</label></td>
				<td><input type="text" id="amount" name="amount" class="input"/></td>
				<td></td>
			</tr>
			<tr>
				<td><label for="paid" class="label">Praktyka płatna?</label></td>
				<td style="vertical-align: middle";><input type="checkbox" id="paid" name="paid" /></td>
				<td></td>
			</tr>	
			<tr>
				<td><label for="duties" class="label">Zakres obowiązków</label></td>
				<td><textarea name="duties" id="duties" rows="5" cols="20" class="input"></textarea></td>
				<td></td>
			</tr>
			<tr>
				<td><label for="requirements" class="label">Wymagania</label></td>
				<td><textarea name="requirements" id="requirements" rows="5" cols="20" class="input"></textarea></td>
				<td></td>
			</tr>
			<tr>
				<td><label for="technology" class="label">Technologie</label></td>
				<td>
				{foreach item=tech from=$technologies}
					<input type="checkbox" name ="tech[]" id="tech_id_{$tech.id}" value="{$tech.technology}" /> {$tech.technology} <br/>
				{/foreach}
				</td>
				<td></td>
			</tr>			

			{if $smarty.session.user_type == 'user_student' }
			
			{/if}
			
		</table>
	</div>
	<div style="clear:both"></div>
	<input type="submit" value="Wyślij" id="send" name="send" class="button"/>
</form>
{/if}

{include file="footer.tpl"}